﻿var tr01_03 = "#FFFFFF";
var tab01 = "#2F7495";  //边框颜色
var kongj;
var kongj_code;
var clicObj;


//tile
var style1 = 'style="color: #656565;BACKGROUND-COLOR:#e7f1fd;font-size: 9pt;"';

//title:城市拼音首字母
var style2 = 'style="BACKGROUND-COLOR: #c8e3fc; color: #656565;background-repeat:repeat-x; background-position:bottom; font-size: 9pt;"';

var style3 = 'style="position: relative; left: 0px; top: 0px; width: 100%;overflow:hidden; text-overflow:ellipsis;"';

//省会城市 北京|PEK|B  城市|三字代码|拼音首字母
var shcs = new Array("北京|PEK|B","上海|SHA|S","广州|CAN|G","深圳|SZX|S","成都|CTU|C","重庆|CKG|C","厦门|XMN|X","昆明|KMG|K","杭州|HGH|H","西安|XIY|X","海口|HAK|H","哈尔滨|HRB|H","长沙|CSX|C","武汉|WUH|W","大连|DLC|D","南京|NKG|N","沈阳|SHE|S","青岛|TAO|Q","三亚|SYX|S","郑州|CGO|Z","天津|TSN|T","长春|CGQ|C","南宁|NNG|N","济南|TNA|T","贵阳|KWE|G","福州|FOC|F","温州|WNZ|W","太原|TYN|T","桂林|KWL|G","宁波|NGB|N","石家庄|SJW|S","拉萨|LXA|L");

//所有城市
var qtcs = new Array("阿勒泰|AAT|A","安庆|AQG|A","阿克苏|AKU|A","安康|AKA|A","鞍山|IOB|A","保山|BSD|B","包头|BAV|B","北海|BHY|B","北京|PEK|B","长沙|CSX|C","长春|CGQ|C","常德|CGD|C","长治|CIH|C","常州|CZX|C","昌都|BPX|C","朝阳|CHG|C","成都|CTU|C","赤峰|CIF|C","重庆|CKG|C","敦煌|DNH|D","大理|DLU|D","大连|DLC|D","大同|DAT|D","大庆|DQA|D","丹东|DDG|D","达县|DAX|D","芒市|LUM|M","东营|DOY|D","恩施|ENH|E","鄂尔多斯|DSN|E","阜阳|FUG|F","福州|FOC|F","赣州|KOW|G","格尔木|GOQ|G","广元|GYS|G","广州|CAN|G","广汉|GHN|G","桂林|KWL|G","贵阳|KWE|G","怀化|HJJ|H","邯郸|HDG|H","哈尔滨|HRB|H","海口|HAK|H","海拉尔|HLD|H","哈密|HMI|H","汉中|HZG|H","杭州|HGH|H","合肥|HFE|H","衡阳|HNY|H","和田|HTN|H","呼和浩特|HET|H","黄山|TXN|H","黄岩|HYN|H","惠阳|AHE|H","黑河|HEK|H","吉林|JIL|J","济南|TNA|J","济宁|JNG|J","吉安|KNC|J","锦州|JNZ|J","景德镇|JDZ|J","荆州、沙市|SHS|J","九江|JIU|J","九寨沟|JZH|J","佳木斯|JMU|J","库尔勒|KRL|K","库车|KCA|K","喀什|KHG|K","克拉玛依|KRY|K","昆明|KMG|K","喀纳斯|KJI|K","拉萨|LXA|L","兰州|LHW|L","连云港|LYG|L","梁平|LIA|L","临沂|LYI|L","临沧|LNJ|L","柳州|LZH|L","泸州|LZO|L","洛阳|LYA|L","满州里|NZH|M","梅县|MXZ|M","绵阳|MIG|M","牡丹江|MDG|M","南京|NKG|N","南昌|KHN|N","南充|NAO|N","南宁|NNG|N","南通|NTG|N","南阳|NNY|N","宁波|NGB|N","那拉提|NLT|N","鄂尔多斯|DSN|O","攀枝花|PZI|P","齐齐哈尔|NDG|Q","且末|IQM|Q","秦皇岛|SHP|Q","青岛|TAO|Q","庆阳|IQN|Q","衢州|JUZ|Q","晋江|JJN|J","三亚|SYX|S","揭阳|SWA|J","上海|SHA|S","鄯善|SXJ|S","韶关|SHG|S","沈阳|SHE|S","深圳|SZX|S","石家庄|SJW|S","思茅|SYM|S","塔城|TCG|T","腾冲|TCZ|T","太原|TYN|T","天津|TSN|T","铜仁|TEN|T","万州|WXN|W","潍坊|WEF|W","威海|WEH|W","温州|WNZ|W","武汉|WUH|W","乌鲁木齐|URC|W","武夷山|WUS|W","无锡|WUX|W","梧州|WUZ|W","文山|WNH|W","锡林浩特|XIL|X","西安|SIA|X","迪庆|DIG|D","西宁|XNN|X","西双版纳|JHG|X","厦门|XMN|X","襄阳|XFN|X","西昌|XIC|X","兴义|ACX|X","徐州|XUZ|X","盐城|YNZ|Y","宜昌|YIH|Y","银川|INC|Y","运城|YCU|Y","永州|LLF|Y","延吉|YNJ|Y","烟台|YNT|Y","延安|ENY|Y","宜宾|YBP|Y","义乌|YIW|Y","伊宁|YIN|Y","榆林|UYN|Y","湛江|ZHA|Z","张家界|DYG|Z","昭通|ZAT|Z","郑州|CGO|Z","舟山|HSN|Z","珠海|ZUH|Z","遵义|ZYI|Z","丽江|LJG|L","漠河|OHE|M", "珠海|ZUH|Z", "通辽|TGO|T", "淮安|HIA|H", "黔江|JIQ|Q", "长白山|NBS|C", "长白山|BAS|C");
//酒店
var qtcs_ht=new Array("阿勒泰|AAT|A","阿坝州|ABA|A","阿城|ACH|A","安康|AKA|A","阿克苏|AKU|A","安吉|ANJ|A","安陆|ANL|A","安顺|ANS|A","鞍山|AOG|A","安庆|AQG|A","阿图什|ATU|A","安阳|AYN|A","北京|PEK|B","白城|BAC|B","保定|BAD|B","宝鸡|BAJ|B","白山|BAS|B","包头|BAV|B","巴中|BAZ|B","北戴河|BDH|B","北安|BEA|B","北流|BEL|B","北宁|BEN|B","本溪|BEX|B","蚌埠|BFU|B","北海|BHY|B","毕节|BIJ|B","滨州|BIZ|B","博乐|BOL|B","亳州|BOZ|B","保山|BSD|B","百色|BSI|B","广州|CAN|C","沧州|CAZ|C","昌都|CDA|C","昌都地区|CDU|C","郴州|CEZ|C","常德|CGD|C","长葛|CGE|C","郑州|CGO|C","长春|CGQ|C","澄海|CHA|C","赤壁|CHB|C","承德|CHD|C","朝阳|CHG|C","昌吉|CHJ|C","常宁|CHN|C","常熟|CHS|C","巢湖|CHU|C","酒泉|CHW|C","楚雄|CHX|C","潮阳|CHY|C","崇州|CHZ|C","赤峰|CIF|C","长治|CIH|C","慈溪|CIX|C","重庆|CKG|C","从化|COH|C","长沙|CSX|C","成都|CTU|C","滁州|CUZ|C","潮州|CZH|C","池州|CZU|C","常州|CZX|C","大安|DAA|D","大丰|DAF|D","丹江口|DAJ|D","大庆|DAQ|D","大同|DAT|D","大兴安岭|DAX|D","当阳|DAY|D","儋州|DAZ|D","丹东|DDG|D","登封|DEF|D","德令哈|DEL|D","德阳|DEY|D","邓州|DEZ|D","东莞|DGM|D","迪庆|DIG|D","迪庆州|DIQ|D","定西地区|DIX|D","大连|DLC|D","大理|DLU|D","敦煌|DNH|D","都江堰|DOJ|D","东台|DOT|D","东兴|DOX|D","东营|DOY|D","敦化|DUH|D","都匀|DUJ|D","定西|DXN|D","丹阳|DYA|D","大冶|DYE|D","张家界|DYG|D","东阳|DYN|D","达州|DZH|D","德州|DZO|D","峨眉山|EMS|E","恩施|ENH|E","恩平|ENP|E","延安|ENY|E","鄂尔多斯|ERD|E","二连浩特|ERL|E","鄂州|EZH|E","防城港|FAC|F","丰城|FEC|F","奉化|FEH|F","福州|FOC|F","福安|FUA|F","福鼎|FUD|F","阜阳|FUG|F","阜康|FUK|F","佛山|FUO|F","福清|FUQ|F","抚顺|FUS|F","阜新|FUX|F","富阳|FUY|F","抚州|FUZ|F","藁城|GAC|G","高明|GAM|G","高邮|GAY|G","甘孜州|GAZ|G","个旧|GEJ|G","广汉|GHN|G","格尔木|GOQ|G","巩义|GOY|G","广安|GUA|G","贵港|GUG|G","桂平|GUP|G","广水|GUS|G","贵溪|GUX|G","广元|GUY|G","赣州|GZH|G","韩城|HAC|H","海东地区|HAD|H","海宁|HAI|H","海宁|HAI|H","海口|HAK|H","海林|HAL|H","海门|HAM|H","海南州|HAN|H","汉川|HCH|H","邯郸|HDN|H","海东|HDO|H","花都|HDU|H","鹤壁|HEB|H","河池|HEC|H","鹤岗|HEG|H","黑河|HEK|H","呼和浩特|HET|H","河源|HEY|H","合作|HEZ|H","合肥|HFE|H","杭州|HGH|H","香港|HKG|H","葫芦岛|HLD|H","乌兰浩特|HLH|H","虎林|HLI|H","哈密|HMI|H","衡阳|HNY|H","洪湖|HOH|H","侯马|HOM|H","哈尔滨|HRB|H","韶关|HSC|H","鹤山|HSH|H","舟山|HSN|H","衡水|HSU|H","和田|HTN|H","淮安|HUA|H","淮北|HUB|H","晖春|HUC|H","华甸|HUD|H","黄冈|HUG|H","怀化|HUH|H","淮南|HUI|H","呼伦贝尔|HUL|H","黄南州|HUN|H","黄石|HUS|H","惠州|HUZ|H","惠阳|HYA|H","黄骅|HYE|H","华阴|HYI|H","黄岩|HYN|H","菏泽|HZE|H","汉中|HZG|H","贺州|HZH|H","湖州|HZO|H","化州|HZU|H","银川|INC|I","庆阳|IQN|I","姜堰|JAN|J","金昌|JCH|J","江都|JDU|J","景德镇|JDZ|J","嘉峪关|JGN|J","井冈山|JGS|J","金华|JHA|J","蛟河|JHE|J","西双版纳|JHG|J","集安|JIA|J","晋城|JIC|J","建德|JID|J","景洪|JIH|J","靖江|JIJ|J","吉林|JIL|J","江门|JIM|J","集宁|JIN|J","建瓯|JIO|J","界首|JIS|J","金坛|JIT|J","九江|JIU|J","嘉兴|JIX|J","江阴|JIY|J","胶州|JIZ|J","晋江|JJA|J","荆门|JMN|J","即墨|JMO|J","佳木斯|JMU|J","胶南|JNA|J","济宁|JNG|J","锦州|JNZ|J","江山|JSA|J","吉首|JSH|J","句容|JUR|J","衢州|JUZ|J","鸡西|JXI|J","济源|JYA|J","建阳|JYG|J","揭阳|JYN|J","江油|JYO|J","荆州|JZG|J","九寨沟|JZH|J","晋中|JZO|J","焦作|JZU|J","开封|KAF|K","凯里|KAL|K","开平|KAP|K","开远|KAY|K","喀什|KHG|K","南昌|KHN|K","克拉玛依|KLY|K","昆明|KMG|K","吉安|KNC|K","库尔勒|KRL|K","昆山|KUS|K","奎屯|KUT|K","贵阳|KWE|K","桂林|KWL|K","开原|KYA|K","廊坊|LAF|L","老河口|LAH|L","六安|LAN|L","六安|LAN|L","莱芜|LAW|L","兰溪|LAX|L","莱阳|LAY|L","阆中|LAZ|L","临沧|LCH|L","聊城|LCN|L","乐昌|LEC|L","乐清|LEQ|L","冷水江|LES|L","雷州|LEZ|L","临海|LHA|L","连州|LHO|L","兰州|LHW|L","临安|LIA|L","灵宝|LIB|L","临沧地区|LIC|L","临汾|LIF|L","凌海|LIH|L","丽江|LJG|L","丽江地区|LIJ|L","六盘水|LIP|L","丽水|LIS|L","辽源|LIU|L","临夏|LIX|L","辽阳|LIY|L","林芝地区|LIZ|L","临江|LJN|L","娄底|LOD|L","龙井|LOJ|L","龙口|LOK|L","龙泉|LOQ|L","龙岩|LOY|L","乐山|LSA|L","离石|LSH|L","罗定|LUD|L","陆丰|LUF|L","漯河|LUH|L","潞西|LUX|L","庐山|LUZ|L","拉萨|LXA|L","洛阳|LYA|L","连云港|LYG|L","临沂|LYI|L","溧阳|LYN|L","涟源|LYU|L","柳州|LZH|L","林芝|LZI|L","林州|LZN|L","泸州|LZO|L","莱州|LZU|L","马鞍山|MAA|M","麻城|MAC|M","茂名|MAM|M","满洲里|MAZ|M","牡丹江|MDG|M","梅河口|MEH|M","眉山|MES|M","孟州|MEZ|M","澳门|MFM|M","绵阳|MIG|M","米泉|MIQ|M","密山|MIS|M","绵竹|MIZ|M","梅州|MZU|M","南安|NAA|N","南海|NAH|N","南充|NAO|N","南平|NAP|N","那曲地区|NAQ|N","那曲|NAU|N","南雄|NAX|N","齐齐哈尔|NDG|N","内江|NEJ|N","宁波|NGB|N","宁安|NIA|N","宁德|NID|N","宁国|NIG|N","南京|NKG|N","南宁|NNG|N","南阳|NNY|N","南通|NTG|N","盘锦|PAJ|P","番禺|PAY|P","平顶山|PDS|P","北京|PEK|P","蓬莱|PEL|P","彭州|PEZ|P","平度|PID|P","平湖|PIH|P","平凉|PIL|P","萍乡|PIX|P","邳州|PIZ|P","普宁|PUN|P","莆田|PUT|P","濮阳|PUY|P","凭祥|PXA|P","攀枝花|PZI|P","琼海|QHA|Q","启东|QID|Q","千岛湖|QIH|Q","潜江|QIJ|Q","邛崃|QIL|Q","七台河|QIT|Q","庆阳地区|QIY|Q","青州|QIZ|Q","曲阜|QUF|Q","曲靖|QUJ|Q","泉州|QUZ|Q","沁阳|QYA|Q","清远|QYN|Q","钦州|QZO|Q","仁怀|REH|R","任丘|REQ|R","日喀则|RIK|R","日照|RIZ|R","荣城|ROC|R","瑞安|RUA|R","如皋|RUG|R","瑞丽|RUL|R","乳山|RUS|R","汝州|RUZ|R","三门峡|SAM|S","三水|SAS|S","上海|SHA|S","顺德|SHD|S","沈阳|SHE|S","山南|SHG|S","石河子|SHH|S","石狮|SHI|S","商洛|SHL|S","山南地区|SHN|S","秦皇岛|SHP|S","商丘|SHQ|S","上饶|SHR|S","韶山|SHS|S","汕尾|SHW|S","绍兴|SHX|S","双鸭山|SHY|S","朔州|SHZ|S","西安|SIA|S","四会|SIH|S","四平|SIP|S","石家庄|SJW|S","舒兰|SLA|S","三明|SMI|S","神农架林区|SNJ|S","松滋|SOH|S","松原|SOY|S","松滋宾馆|SOZ|S","石首|SSH|S","绥芬河|SUF|S","绥化|SUH|S","遂宁|SUN|S","随州|SUZ|S","揭阳|SWA|J","邵武|SWU|S","十堰|SYA|S","邵阳|SYG|S","思茅|SYM|S","上虞|SYU|S","三亚|SYX|S","尚志|SZI|S","嵊州|SZU|S","苏州|SZV|S","深圳|SZX|S","泰安|TAA|T","太仓|TAC|T","青岛|TAO|T","唐山|TAS|T","泰兴|TAX|T","台州|TAZ|T","塔城|TCG|T","通辽|TGO|T","天长|TIC|T","铁岭|TIL|T","天门|TIM|T","天水|TIS|T","铁力|TLI|T","济南|TNA|T","通化|TNH|T","铜川|TOC|T","铜陵|TOG|T","同里|TOL|T","铜仁|TOR|T","通什|TOS|T","桐乡|TOX|T","通洲|TOZ|T","台山|TSA|T","天津|TSN|T","吐鲁番|TUL|T","黄山|TXN|T","太原|TYN|T","泰州|TZU|T","乌鲁木齐|URC|U","榆林|UYN|U","万宁|WAN|W","文昌|WEC|W","文登|WED|W","潍坊|WEF|W","温岭|WEG|W","威海|WEH|W","温蛉|WEL|W","渭南|WEN|W","文山州|WES|W","乌海|WHA|W","芜湖|WHU|W","吴江|WJI|W","温州|WNZ|W","武汉|WUH|W","武进|WUJ|W","武夷山|WUS|W","武威|WUW|W","无锡|WUX|W","梧州|WUZ|W","武穴|WXI|W","咸宁|XAN|X","许昌|XCA|X","项城|XCH|X","兴城|XEN|X","襄阳|XFN|X","孝感|XGN|X","仙桃|XIA|X","西昌|XIC|X","香格里拉|XIG|X","新会|XIH|X","锡林浩特|XIL|X","新密|XIM|X","新沂|XIN|X","宿州|XIO|X","宿迁|XIQ|X","湘潭|XIT|X","忻州|XIU|X","新乡|XIX|X","咸阳|XIY|X","厦门|XMN|X","西宁|XNN|X","邢台|XNT|X","宣城|XUC|X","徐州|XUZ|X","信阳|XYA|X","荥阳|XYG|X","信宜|XYI|X","兴义|XYN|X","新余|XYU|X","五指山|XZS|X","雅安|YAA|Y","阳春|YAC|Y","雁荡山|YAD|Y","阳朔|YAH|Y","阳江|YAJ|Y","阳泉|YAQ|Y","偃师|YAS|Y","扬中|YAZ|Y","宜宾|YBP|Y","伊春|YCH|Y","宜春|YIC|Y","宜昌|YIH|Y","营口|YIK|Y","伊宁|YIN|Y","鹰潭|YIT|Y","义乌|YIW|Y","宜兴|YIX|Y","益阳|YIY|Y","仪征|YIZ|Y","云浮|YNF|Y","延吉|YNJ|Y","烟台|YNT|Y","盐城|YNZ|Y","永安|YOA|Y","永康|YOK|Y","永州|YOZ|Y","余姚|YUA|Y","运城|YUC|Y","玉林|YUL|Y","玉门|YUM|Y","玉树州|YUS|Y","玉溪|YUX|Y","岳阳|YUY|Y","禹州|YUZ|Y","兖州|YZH|Y","扬州|YZO|Y","宜州|YZU|Y","昭通|ZAT|Z","枣阳|ZAY|Z","枣庄|ZAZ|Z","湛江|ZHA|Z","株洲|ZHC|Z","遵化|ZHH|Z","张家港|ZHJ|Z","周口|ZHK|Z","扎兰屯|ZHL|Z","驻马店|ZHM|Z","周庄|ZHN|Z","株州|ZHO|Z","漳平|ZHP|Z","肇庆|ZHQ|Z","涿州|ZHU|Z","钟祥|ZHX|Z","张掖|ZHY|Z","漳州|ZHZ|Z","淄博|ZIB|Z","自贡|ZIG|Z","中山|ZIS|Z","资兴|ZIX|Z","资阳|ZIY|Z","镇江|ZJA|Z","诸暨|ZJI|Z","张家口|ZJK|Z","邹城|ZOC|Z","珠海|ZUH|Z","遵义|ZYI|Z");

var ywzm = new Array("A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","S","T","W","X","Y","Z") 
var popup_gd=25;  //数据显示高度
var popup_i; 
var popup_int0=0;
var popup_int1=0;
var popup_int2=0;
var popup_int3=0;

function Split(popup_str,popup_n,popup_s){ //字符串,取第几个数据,分割字符
	var popup_split=popup_str.split(popup_s);
	return popup_split[popup_n];
}

var objPopup;//城市展示容器层

function popUp(abc,code,configObj,ht){
    if(typeof(abc)=='string')
    {
    	kongj=document.getElementById(abc);
    	kongj_code=document.getElementById(code);
    }
    else
    {
    	kongj=abc;
    	kongj_code=code;
    }
    
	var objBody = document.getElementById("mainbody");
	
	if(configObj && configObj["getCityListFunction"]){
		shcs=configObj.getCityListFunction(abc,code).shcs;
		qtcs=configObj.getCityListFunction(abc,code).qtcs;
	}else {
		
	}
	qtcs = new Array("额济纳旗|EJN|E","阿拉善右旗|RHT|A","阿拉善左旗|AXF|A","宜春|YIC|Y","毕节|BFJ|B","吐鲁番|TLQ|T","博乐|BPL|B","乌兰浩特|HLH|W","康定|KGT|K","巴彦淖尔|RLK|B","大庆|DQA|D","伊春|LDS|Y","阿里|NGQ|A","嘉峪关|JGN|J","张掖|YZY|Z","金昌|JIC|J","玉树|YUS|Y","加各达奇|JGD|J","百色|AEB|A","龙岩|LCX|L","张家口|ZQZ|Z","固原|GYU|G","黎平|HZH|H","荔波|LLB|L","安顺|AVA|A","阿勒泰|AAT|A","安庆|AQG|A","阿克苏|AKU|A","安康|AKA|A","鞍山|IOB|A","保山|BSD|B","包头|BAV|B","北海|BHY|B","北京|PEK|B","长沙|CSX|C","长春|CGQ|C","常德|CGD|C","长治|CIH|C","常州|CZX|C","昌都|BPX|C","朝阳|CHG|C","成都|CTU|C","赤峰|CIF|C","重庆|CKG|C","敦煌|DNH|D","大理|DLU|D","大连|DLC|D","大同|DAT|D","丹东|DDG|D","达县|DAX|D","芒市|LUM|M","东营|DOY|D","恩施|ENH|E","鄂尔多斯|DSN|E","阜阳|FUG|F","福州|FOC|F","赣州|KOW|G","格尔木|GOQ|G","广元|GYS|G","广州|CAN|G","广汉|GHN|G","桂林|KWL|G","贵阳|KWE|G","怀化|HJJ|H","邯郸|HDG|H","哈尔滨|HRB|H","海口|HAK|H","海拉尔|HLD|H","哈密|HMI|H","汉中|HZG|H","杭州|HGH|H","合肥|HFE|H","衡阳|HNY|H","和田|HTN|H","呼和浩特|HET|H","黄山|TXN|H","黄岩|HYN|H","惠阳|AHE|H","黑河|HEK|H","吉林|JIL|J","济南|TNA|J","济宁|JNG|J","锦州|JNZ|J","景德镇|JDZ|J","荆州、沙市|SHS|J","九江|JIU|J","九寨沟|JZH|J","佳木斯|JMU|J","库尔勒|KRL|K","库车|KCA|K","喀什|KHG|K","克拉玛依|KRY|K","昆明|KMG|K","喀纳斯|KJI|K","拉萨|LXA|L","兰州|LHW|L","连云港|LYG|L","梁平|LIA|L","临沂|LYI|L","临沧|LNJ|L","柳州|LZH|L","泸州|LZO|L","洛阳|LYA|L","满州里|NZH|M","梅县|MXZ|M","绵阳|MIG|M","牡丹江|MDG|M","南京|NKG|N","南昌|KHN|N","南充|NAO|N","南宁|NNG|N","南通|NTG|N","南阳|NNY|N","宁波|NGB|N","那拉提|NLT|N","鄂尔多斯|DSN|O","攀枝花|PZI|P","齐齐哈尔|NDG|Q","且末|IQM|Q","秦皇岛|SHP|Q","青岛|TAO|Q","庆阳|IQN|Q","衢州|JUZ|Q","晋江|JJN|J","三亚|SYX|S","揭阳|SWA|J","上海|SHA|S","上海虹桥|SHA|S","上海浦东|PVG|S","鄯善|SXJ|S","韶关|SHG|S","沈阳|SHE|S","深圳|SZX|S","石家庄|SJW|S","思茅|SYM|S","塔城|TCG|T","太原|TYN|T","天津|TSN|T","铜仁|TEN|T","唐山|TVS|T","天水|THQ|T","万州|WXN|W","潍坊|WEF|W","威海|WEH|W","温州|WNZ|W","武汉|WUH|W","乌鲁木齐|URC|W","武夷山|WUS|W","无锡|WUX|W","梧州|WUZ|W","文山|WNH|W","乌海|WUA|W","锡林浩特|XIL|X","西安|SIA|X","迪庆|DIG|D","西宁|XNN|X","西双版纳|JHG|X","景洪|JHG|J","厦门|XMN|X","襄阳|XFN|X","西昌|XIC|X","兴义|ACX|X","徐州|XUZ|X","盐城|YNZ|Y","宜昌|YIH|Y","银川|INC|Y","运城|YCU|Y","永州|LLF|Y","延吉|YNJ|Y","烟台|YNT|Y","延安|ENY|Y","宜宾|YBP|Y","义乌|YIW|Y","伊宁|YIN|Y","榆林|UYN|Y","湛江|ZHA|Z","张家界|DYG|Z","昭通|ZAT|Z","中卫|ZHY|Z","郑州|CGO|Z","舟山|HSN|Z","珠海|ZUH|Z","遵义|ZYI|Z","丽江|LJG|L","漠河|OHE|M","林芝|LZY|L", "通辽|TGO|T", "鸡西|JXA|J","腾冲|TCZ|T","淮安|HIA|H","佛山|FUO|F","阿尔山|YIE|A","二连浩特|ERL|E","巴彦淖尔|RLK|R","扬州|YTY|Y","井冈山|JGS|J","黔江|JIQ|Q","固原|GYU|QG","长白山|NBS|C","稻城|DCY|D","九华山|JUH|J","夏河|GXH|X", "长白山|BAS|C", "凯里|KJH|K", "神农架|HPG|S", "抚远|FYJ|F", "喀纳斯|KJI|G", "河池|HCJ|H");
    
    if(ht){qtcs=qtcs_ht;}

	if( !document.getElementById("city_popup") )
	{
	    objPopup = document.createElement("div");
	}
	objPopup.style.visibility="hidden";
	objPopup.className="popdiv"; 
    if(kongj.value=="中文/拼音"){
    	kongj.value="";
    }
    
    popup_int0=0;
    popup_int1=0;
    popup_int2=0;
    popup_int3=0;
    var tab;
    tab = '<iframe id=popup_city_iframe vspace="0" hspace="0" marginwidth="0" marginheight="0" border="0" frameborder="0" scrolling="no" style="position:absolute;left:0px; top:0px; z-index:-1; width:290px; height:202px;"></iframe>';
    tab += '<div id="_div_tmp" class=_div_tmp align="center"></div>';
    tab+= '<table width="290" border="0" cellpadding="0" cellspacing="1" style="border:1px solid ' +tab01+ ';">';
    tab+= '<tr>';
    tab+= '<td>';
	tab+= '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="header_tips">';
	if(configObj && configObj["showReset"] && configObj.showReset){
		tab+= '  <tr align="center"><td height="22" class=input_title ><div style="float:left;margin-left:5px;">请选择城市或输入城市名称的拼音</div><div style="float:right;"><a href="javascript:popup_hide()" id=resetLink >关闭</a></div></td></tr>';
	}else {
		tab+= '  <tr align="center"><td height="22" class=input_title ><div style="float:left;margin-left:5px;">请选择城市或输入城市名称的拼音</div><div style="float:right;"><a href="javascript:popup_hide()" id=resetLink >关闭</a></div></td></tr>';
	}
    
    tab+= '  <tr align="left">';
	tab+= '    <td height="20" class=td_tab_container >';
    tab+= '      <table width="100%" align="left" border="0" cellspacing="0" cellpadding="0" >'
	tab+= '			<tr><td width="2"></td><td><table cellpadding="0" cellspacing="0"><tr align="left">';
    if(shcs.length==qtcs.length){
		tab+= '        <td id="H_SH" width="13%"><label id="SH" class=tab_label >全部</label>|</td>';
	}else {
		tab+= '        <td id="H_SH" width="13%"><label id="SH" class=tab_label >省会</label>|</td>';
	}
	
	for(var ywzm_i=0;ywzm_i<26;ywzm_i++){
		if(!ywzm[ywzm_i])
			break;
		tab+= '<td id=H_"'+ywzm[ywzm_i]+'"><label id="syy_'+ywzm[ywzm_i]+'" class=tab_label >'+ywzm[ywzm_i]+'</label></td>';
	}
    tab+= '      </tr></table></td></tr></table>';
    tab+= '    </td>';
    tab+= '  </tr>';
    tab+= '  <tr align="center">';
    tab+= '   <td id="Popup_Tab">';
    tab+= '    <table cellspacing="1" cellpadding="0" >';

    for(popup_i=0;popup_i<36;popup_i++){
    	if(popup_i==0 || popup_i % 6 ==0){
    		tab+= '  <tr align="center">';
    	}
    	if(shcs[popup_i]){
    		tab+= '    <td height="'+popup_gd+'" width="14.3%" ID="popup_td_cszm_'+popup_int0+'" title="'+Split(shcs[popup_i],0,"|")
			+'" class="popup_NOBR_container" ><NOBR class=popup_NOBR ID="popup_NOBR_cszm_'+Split(shcs[popup_i],1,"|")
			+'_'+popup_int0+'">'+Split(shcs[popup_i],0,"|")+'</NOBR></td>';
    		popup_int0++;
    	}else{
    		tab+= '    <td height="'+popup_gd+'" width="14.3%">&nbsp;</td>';
    	}
    	popup_int3 = popup_i+1;
    	if(popup_int3 % 6 ==0){
    		tab+= '  </tr>';
    	}
    }
    
    tab+= '    </table>';
    tab+= '   </td>';
    tab+= '  </tr>';
    tab+= '</table>';
    tab+= '</td>';
    tab+= '</tr>';
    tab+= '</table>';
	objPopup.innerHTML = tab;
    objPopup.onclick = Htc_OnClick;
    objPopup.onmousemove = Htc_Onmousemove;
	objPopup.setAttribute('id','city_popup');
	objBody.appendChild(objPopup);
	
    fix_div_coordinate(kongj);
	objPopup.style.visibility="visible"; 
	
	if(configObj && configObj["showReset"] && configObj.showReset && configObj["resetFunction"]){
		document.getElementById("resetLink").onclick=configObj["resetFunction"];
	}
}

function fix_div_coordinate(obj)
{
		var leftpos=0;
		var toppos=0;
        aTag = obj;
		do {
			if( aTag.offsetParent )
			{
			    aTag = aTag.offsetParent;
			}
			else
			{
			    leftpos += aTag.style.left;
			    toppos += aTag.style.top;
			    break;
			}
			leftpos	+= aTag.offsetLeft;
			toppos += aTag.offsetTop;
		}while(aTag.name!="body");

		if(document.layers){
			document.getElementById("city_popup").style.left = obj.offsetLeft	+ parseInt(leftpos) + "px";
			document.getElementById("city_popup").style.top = obj.offsetTop +	parseInt(toppos) + obj.offsetHeight + 2 + "px";
		}else{
			document.getElementById("city_popup").style.left =obj.offsetLeft	+ parseInt(leftpos)  +"px";
			document.getElementById("city_popup").style.top = obj.offsetTop +	parseInt(toppos) + obj.offsetHeight + 2 + "px";
		}
}

function popup_hide()
{
    if( objPopup.style.visibility == "visible" )objPopup.style.visibility="hidden";
}

function Htc_OnClick(){  //鼠标点击事件
  var Htc_str;
    //以下的写法对IE和FireFox都有效
  var evt=(arguments[0]||window.event);
  var element=evt.srcElement||evt.target;
  var e=element;
  clicObj= e;
  
  if (e.tagName == "LABEL")  {
	  if(e.id!=""){
		  yc_dt(e.id);
	  }
  }
  if (e.tagName == "NOBR")  {
	  f_z(document.getElementById(e.id).innerHTML);
	  objPopup.style.visibility="hidden"; 
  }
  
  if (e.tagName == "TD"){//H_
	  if(e.id!=""){
	  	  if(Split(e.id,2,"_")=="cszm"){
	  	  	f_z(document.getElementById(e.id).childNodes[0].innerHTML);
	  		objPopup.style.visibility="hidden"; 
	  	  }else {
	  	  	yc_dt(Split(e.id,1,"_"));	  
	  	  }
		  
	  }
  }
  if (e.tagName == "DIV") {
	  if(e.innerHTML != "") yc_dt(e.innerHTML);
  }
}

var ll="popup_td_cszm_0";
function Htc_Onmousemove(){   //鼠标移动事件

  //以下的写法对IE和FireFox都有效
  var evt=(arguments[0]||window.event);
  var element=evt.srcElement||evt.target;
  var e=element;

  if (e.tagName == "TD" && e.id.split("_")[0]!="H")  {
	  if(e.id!=""){turnrowcolor(e.id,ll);MYopoupmovOut();}
  }
  if (e.tagName == "NOBR")  {
	  if(e.id!=""){turnrowcolor("popup_td_cszm_"+Split(e.id,4,"_"),ll);MYopoupmovOut();}
  }
  if (e.tagName == "LABEL") {
	  //MYopoupmov(e.id);
  }
}

function turnrowcolor(ss,ls){   //鼠标移动TD背景颜色
  var bc="#e7f1fd";
  if(document.getElementById(ls))document.getElementById(ls).style.backgroundColor="";
  if(document.getElementById(ss))document.getElementById(ss).style.backgroundColor=bc;
  if(document.getElementById(ss))document.getElementById(ss).style.cursor="pointer";
  ll=ss;	
}

var yc_dt_cs="SH";
function yc_dt(cs){ 
	//if(cs!=yc_dt_cs){
		if(cs.length=3)cs = cs.replace(/"/g,"");
		if(document.getElementById("syy_" + cs))document.getElementById("syy_" + cs).style.color="#21407D";
		if(document.getElementById("syy_" + yc_dt_cs))document.getElementById("syy_" + yc_dt_cs).style.color="#21407D";
		yc_dt_cs=cs;
		if(cs=="SH" || cs=="省会"){
			Popup_tab(cs,1);
		}else{
			Popup_tab(cs,0);
		}
	//}
}

function Popup_tab(str,lx){ //生成数据
	var Popup_dat_i=0;
	var Popup_dat_n;
	var Popup_dat_tab="";
	var Popup_dat =new Array();
	
	if( Split(str,0,'_')=="syy" )str=Split(str,1,'_');

	if(lx==0){
		for(Popup_dat_n=0;Popup_dat_n<qtcs.length;Popup_dat_n++){
			if(Split(qtcs[Popup_dat_n],2,"|")==str){
				Popup_dat[Popup_dat_i++]=qtcs[Popup_dat_n];
			}
		}
	}else{
		Popup_dat=shcs;
	}
	popup_int0=0;
	
	//Popup_dat_tab+= '<table width="100%" border="0" cellspacing="1" cellpadding="0" style="font-size: 9pt;color: #21407D">';
	Popup_dat_tab+= '<table cellspacing="1" cellpadding="0">';
	var n=36;
	if(Popup_dat.length>36){
	    if(Popup_dat.length%6==0){
	        n=Popup_dat.length;
	    }else{	        
	        n=(parseInt(Popup_dat.length/6)+1)*6;
	    }
	}
	for(Popup_dat_n=0;Popup_dat_n<n;Popup_dat_n++){
		if(Popup_dat_n==0 || Popup_dat_n % 6 ==0){
			//Popup_dat_tab+= '  <tr align="center" style="background-color:' +tr01_03+ ';">';
			Popup_dat_tab+= '  <tr align="center">';
		}
		if(Popup_dat[Popup_dat_n]){
			Popup_dat_tab+= '    <td height="'+popup_gd+'" width="14.3%" ID="popup_td_cszm_'+popup_int0+'" title="'
			+Split(Popup_dat[Popup_dat_n],0,"|")+'" class="popup_NOBR_container" >';
			
			Popup_dat_tab+= '<NOBR class="popup_NOBR" ID="popup_NOBR_cszm_'
			+Split(Popup_dat[Popup_dat_n],1,"|")+'_'+popup_int0+'">'
			+Split(Popup_dat[Popup_dat_n],0,"|")+'</NOBR></td>';
			
			popup_int0++;
		}else{
			Popup_dat_tab+= '    <td height="'+popup_gd+'" width="14.3%">&nbsp;</td>';
		}
		popup_int3 = Popup_dat_n+1;
		if(popup_int3 % 6 ==0){
			Popup_dat_tab+= '  </tr>';
		}
	}
	Popup_dat_tab+= '    </table>';
	document.getElementById("Popup_Tab").innerHTML=Popup_dat_tab;
}

function f_z(temp){   //赋值给控件
  kongj.value=temp;
  setCodevalue(temp);
  kongj.style.color="#000000";

}
function setCodevalue(temp){
	var length=qtcs.length;
	
	for(i=0;i<length;i++){
		var tempArray=qtcs[i].split("|");
		if(tempArray[0]==temp){
			//kongj.codevalue=tempArray[1];
			kongj_code.value=tempArray[1];
			break;
		}
	}
	if($("icityregion")){$("icityregion").value="景点/地标/行政区/商业区等";$("PorName").value="";$("CityRegion").value="";}
	if($("hotelparamplan")){changehotelparam(tempArray[1]);}
}

function MYopoupmov(obj){
	var _div = document.getElementById("_div_tmp");
	obj = document.getElementById(obj);

	var leftpos=0;
	var toppos=0;
    aTag = obj;
	do {
		if( aTag.offsetParent )
		{
		    aTag = aTag.offsetParent;
		}
		else
		{
		    leftpos += aTag.style.left;
		    toppos += aTag.style.top;
		    break;
		}
		leftpos	+= aTag.offsetLeft;
		toppos += aTag.offsetTop;
	}while(aTag.id!="mainbody");
	if(document.layers){
		CitySelectnewX = obj.offsetLeft	+ parseInt(leftpos) - 7 + "px";
		CitySelectnewY = obj.offsetTop +	parseInt(toppos) + obj.offsetHeight - 16 + "px";
	}else{
		CitySelectnewX =obj.offsetLeft	+ parseInt(leftpos) - 7 +"px";
		CitySelectnewY = obj.offsetTop +	parseInt(toppos) + obj.offsetHeight - 16 + "px";
	}

	var CitySelectneww = obj.offsetWidth + 14;

	_div.style.left  = CitySelectnewX;
	_div.style.top   = CitySelectnewY;
	_div.style.width = CitySelectneww + "px";
	_div.innerHTML = obj.innerHTML;
	_div.style.display = "";
}

function MYopoupmovOut(){
	if(document.getElementById("_div_tmp").style.display=="")document.getElementById("_div_tmp").style.display = "none";
}

var posLib = {
    getClientLeft:function (el) {
      var r = el.getBoundingClientRect();
      return r.left - this.getBorderLeftWidth(this.getCanvasElement(el));
    },

    getClientTop:    function (el) {
      var r = el.getBoundingClientRect();
      return r.top - this.getBorderTopWidth(this.getCanvasElement(el));
    },

    getLeft:    function (el) {
      return this.getClientLeft(el) + this.getCanvasElement(el).scrollLeft;
    },

    getTop:    function (el) {
      return this.getClientTop(el) + this.getCanvasElement(el).scrollTop;
    },

    getInnerLeft:    function (el) {
      return this.getLeft(el) + this.getBorderLeftWidth(el);
    },

    getInnerTop:    function (el) {
      return this.getTop(el) + this.getBorderTopWidth(el);
    },

    getWidth:    function (el) {
      return el.offsetWidth;
    },

    getHeight:    function (el) {
      return el.offsetHeight;
    },

    getCanvasElement:    function (el) {
      var doc = el.ownerDocument || el.document;    // IE55 bug
      if (doc.compatMode == "CSS1Compat")
        return doc.documentElement;
      else
        return doc.body;
    },

    getBorderLeftWidth:    function (el) {
      return el.clientLeft;
    },

    getBorderTopWidth:    function (el) {
      return el.clientTop;
    },

    getScreenLeft:    function (el) {
      var doc = el.ownerDocument || el.document;    // IE55 bug
      var w = doc.parentWindow;
      return w.screenLeft + this.getBorderLeftWidth(this.getCanvasElement(el)) + this.getClientLeft(el);
    },

    getScreenTop:    function (el) {
      var doc = el.ownerDocument || el.document;    // IE55 bug
      var w = doc.parentWindow;
      return w.screenTop  + this.getClientTop(el);//+ this.getBorderTopWidth(this.getCanvasElement(el))
    }
}